package com.sgq.vue.task;

import com.sgq.vue.config.ConstantPropertiesForEmail;
import com.sgq.vue.service.email.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author: 83778
 * @date: 2023-12-18 18:21
 * @desc:
 */
@Component("emailTask")
public class EmailTask {

    @Autowired
    private EmailService emailService;

    /**
     * 无参任务
     */
    public void send(){
        emailService.send(ConstantPropertiesForEmail.TARGET,ConstantPropertiesForEmail.TITLE,"若依发送一个测试邮件...");
    }

    /**
     * 多参任务
     * @param target   发送目标
     * @param title    标题
     * @param content  内容
     */
    public void send(String target, String title, String content){
        emailService.send(target,title,content);
    }
}
